package Chapter6;

public class Example06 {
	public static void main(String[] args) {
		String str="羽毛球-篮球-乒乓球";
		System.out.println("from the fifth one "+str.substring(4));
		System.out.println("from the fifth to the sixth "+str.substring(4, 6));
		System.out.println("split: ");
		String[] strArray=str.split("-");
		for(int i=0;i<strArray.length;i++) {
			if(i!=strArray.length -1) {
				System.out.println(strArray[i]+",");
			}else {
				System.out.println(strArray[i]);
			}
		}
	}

}
